sequenceDiagram
  participant Test Runner(1)
  participant Tester(3)
  participant Detox Server(5)
  participant Testee(7)
  participant Earl Grey(9)

  %% Note over Test Runner(1),Detox Server(5): Runs on your computer
  %% Note over Testee(7),Earl Grey(9): Runs on the device

  Test Runner(1)->>Tester(3): assertion / action (2)
  Tester(3)->>Detox Server(5): native code as JSON (4)
  Detox Server(5)->>Testee(7): Websocket connection (6)
  Testee(7)-x+Earl Grey(9): native invocation (8)
  Note left of Earl Grey(9): EarlGrey waits for device to become idle again
  Earl Grey(9)->>-Testee(7): (10)
  Testee(7)->>Detox Server(5): (11)
  Detox Server(5)->>Tester(3): (12)
  Tester(3)->>Test Runner(1): (13)
